# api/user_api.py
""" 
author: Men Dong Yang
create_time: 2025/6/19 14:47:21
description: 
"""
from api.api import Api


class AddUser(Api):
    """添加用户接口的信息"""

    def __init__(self, real_name='', phone='', pwd='', true_pwd='', spread_open=1, is_promoter=1, status=1):
        self.method = 'POST'
        self.path = '/adminapi/user/user'
        self.params = None
        self.body = {
            'real_name': real_name,
            'phone': phone,
            'pwd': pwd,
            'true_pwd': true_pwd,
            'spread_open': spread_open,
            'is_promoter': is_promoter,
            'status': status
        }


class SearchUser(Api):
    def __init__(self, nickname, field_key='phone'):
        self.method = 'GET'
        self.path = '/adminapi/user/user'
        self.params = {
            'label_id': '',
            'user_type': '',
            'status': '',
            'sex': '',
            'is_promoter': '',
            'country': '',
            'isMember': '',
            'pay_count': '',
            'user_time_type': '',
            'user_time': '',
            'nickname': nickname,
            'province': '',
            'city': '',
            'page': 1,
            'limit': 15,
            'level': '',
            'group_id': '',
            'field_key': field_key
        }
        self.body = None


class ChangeUserMoney(Api):

    def __init__(self, uid, money_status=1, money=0):
        self.method = 'PUT'
        self.path = f'/adminapi/user/update_other/{uid}.html'
        self.params = None
        self.body = {
            "money_status": money_status,
            "money": money
        }
